package com.tool_stdy.httpclient;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class HttpClientGetTest {

	public static void main(String[] args) throws Exception {
		HttpClient httpClient = HttpClients.createDefault();
		
		HttpGet get = new HttpGet("http://www.baidu.com");
		HttpResponse response = httpClient.execute(get);
		HttpEntity entity = response.getEntity();
		String value = EntityUtils.toString(entity,"utf-8");
		System.out.println(value);
	}
}
